package saas.baseinfo.service.global;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author guan.xin
 * @title BusinessException
 * @description
 * @create 2022-05-24 19:35
 * @since JDK8
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private int errorCode;

    private transient Object[] args;

    private String message;

    private BusinessException linkedException;

    public BusinessException(int errorCode) {
        super();
        this.errorCode = errorCode;
    }

    public BusinessException(String message) {
        this.message = message;
    }

    public BusinessException(int errorCode, Object[] args) {
        super();
        this.errorCode = errorCode;
        this.args = args;
    }

    public BusinessException(int errorCode, String message) {
        super();
        this.errorCode = errorCode;
        this.message = message;
    }

}
